const {authenticateToken} = require("./authMiddleware");
exports.isAdmin = (req, res, next) => {
    authenticateToken(req, res, () => {
        if (req.user.role === 'admin') {
            next();
        } else {
            res.status(400).json({ message: '需要管理员权限' });
        }
    });
}